package com.zhouchb.blog.dao;

import com.zhouchb.blog.bean.Blog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author Zhouchb
 * @Create 2021-09-2021/9/7 :17:06
 * @Description
 */
@Mapper
public interface BlogRepository {

    public int saveBlogDao(Blog blog);
    public List<Blog> getAllBlogDao();
    public Blog getBlogDao(Long id);
    public List<Blog> listBlogDao(@Param("blog") Blog blog);
//推荐 按时间排序
    public List<Blog> listRecommend(Integer size);
    public int updateBlogDao(@Param("id")Long id,@Param("blog")Blog blog);
    public int delBlogDao(Long id);
    /*搜索*/
    public List<Blog> searchBlog(String query);
    //根据typeId查询
    public List<Blog> searchAllByTypeIdBlogs(Long typeId);
//    查询图片是否存在
    public List<Blog> searchPicture(String pictureName);
    //浏览量
    public int updateViews(Long blogId);
    public List<Blog> listBlogByTagId(Long tagId);
    /*archives*/
    public List<String> blogYear();
    public List<Blog> listBlogByYear(String year);
    public int blogTotal();

}
